<?php
$cuantos = 36;
$pagina = (isset($_GET['page']))?$_GET['page']:1;
$desde = ($pagina-1) * $cuantos;
include('../../admin/php/bootstrap.php');
$fbIds = Doctrine_Query::create()
        ->select('e.facebook')
        ->from('Email e')
        ->where('e.facebook IS NOT NULL')
        ->limit($cuantos)
        ->offset($desde)
        ->orderBy('e.id desc')
        ->execute(array(), Doctrine::HYDRATE_SINGLE_SCALAR);
if (!is_array($fbIds)) $fbIds = array($fbIds);

header("Content-type: application/json");
echo(json_encode($fbIds));
?>
